<?php

namespace App\Observers;

use App\Models\OrderModel;
use App\Services\CommonService;
use Illuminate\Support\Facades\Log;

class OrderObserver
{
    /**
     * Handle the order model "created" event.
     *
     * @param  \App\Models\OrderModel  $orderModel
     * @return void
     */
    public function created(OrderModel $orderModel)
    {
        //判端是否能抢单，并推送给司机
        $data = CommonService::seizeOrders($orderModel);
    }

    /**
     * Handle the order model "updated" event.
     *
     * @param  \App\Models\OrderModel  $orderModel
     * @return void
     */
    public function updated(OrderModel $orderModel)
    {
        //
    }

    /**
     * Handle the order model "deleted" event.
     *
     * @param  \App\Models\OrderModel  $orderModel
     * @return void
     */
    public function deleted(OrderModel $orderModel)
    {
        //
    }

    /**
     * Handle the order model "restored" event.
     *
     * @param  \App\Models\OrderModel  $orderModel
     * @return void
     */
    public function restored(OrderModel $orderModel)
    {
        //
    }

    /**
     * Handle the order model "force deleted" event.
     *
     * @param  \App\Models\OrderModel  $orderModel
     * @return void
     */
    public function forceDeleted(OrderModel $orderModel)
    {
        //
    }
}
